import {NgModule} from '@angular/core';
import {RouterModule, Routes} from "@angular/router";
import {SharedModule} from "../../shared/shared.module";
import { NzMessageModule } from 'ng-zorro-antd/message';
import { NzModalModule } from 'ng-zorro-antd/modal';
import { NzBreadCrumbModule } from 'ng-zorro-antd/breadcrumb';
import { NzTableModule } from 'ng-zorro-antd/table';
import { NzToolTipModule } from 'ng-zorro-antd/tooltip';
import { NzSelectModule } from 'ng-zorro-antd/select';
import { NzLayoutModule } from 'ng-zorro-antd/layout';
import { NzButtonModule } from 'ng-zorro-antd/button';
import { NzInputModule } from 'ng-zorro-antd/input';
import { NzSwitchModule } from 'ng-zorro-antd/switch';
import { NzDatePickerModule } from 'ng-zorro-antd/date-picker';
import { NzRadioModule } from 'ng-zorro-antd/radio';
import { NzFormModule } from 'ng-zorro-antd/form';
import { NzIconModule } from 'ng-zorro-antd/icon';
import { NzTabsModule } from 'ng-zorro-antd/tabs';
import { NzDividerModule } from 'ng-zorro-antd/divider';
import { NzUploadModule } from 'ng-zorro-antd/upload';
import { NzEmptyModule } from 'ng-zorro-antd/empty';
import { NzDrawerModule } from 'ng-zorro-antd/drawer';
import { NzPaginationModule } from 'ng-zorro-antd/pagination';
import { NzCheckboxModule } from 'ng-zorro-antd/checkbox';
import { NzTagModule } from 'ng-zorro-antd/tag';
import { CommonModule } from '@angular/common';
import { FormsModule } from '@angular/forms';
import {SellComponent} from "./sell.component";
import {OrderComponent} from "./order/order.component";
import {CartService} from "./order/cart.service";
import {CartComponent} from "./order/cart/cart.component";
import {HistoryComponent} from "./history/history.component";

const routes: Routes = [
    {
        path: '',
        component: SellComponent,
        children: [
            {
                path: 'order',
                data:{ title: 'Order'},
                component: OrderComponent,
            },
            {
                path: 'history',
                data:{ title: 'History'},
                component: HistoryComponent,
            },
            {
                path: '**',
                redirectTo: 'order'
            }
        ]
    }
];

@NgModule({
    declarations: [SellComponent, OrderComponent, CartComponent, HistoryComponent],
    providers: [CartService],
    imports: [
        RouterModule.forChild(routes),
        CommonModule,
        FormsModule,
        NzMessageModule,
        NzModalModule,
        NzBreadCrumbModule,
        NzTableModule,
        NzToolTipModule,
        NzSelectModule,
        NzButtonModule,
        NzInputModule,
        NzSwitchModule,
        NzDatePickerModule,
        NzRadioModule,
        NzFormModule,
        NzIconModule,
        NzTabsModule,
        NzDividerModule,
        NzUploadModule,
        NzLayoutModule,
        NzEmptyModule,
        NzDrawerModule,
        NzPaginationModule,
        NzCheckboxModule,
        NzTagModule,
        SharedModule
    ]
})
export class SellModule {
}
